/**
 * 增量元素差的最大值
 *
 * @USER: Administrator
 * @DATE: 2024/9/28 下午4:33
 * @VERSION: 1.0.0
 */
public class LC2016 {
    public static void main(String[] args) {

    }

    public int maximumDifference(int[] nums) {
        int result = -1;
        for (int i = 0; i < nums.length; i++) {
            for (int j = i + 1; j < nums.length; j++) {
                if (nums[i] < nums[j]) {
                    result = Math.max(result, nums[j] - nums[i]);
                }
            }
        }

        return result;
    }

}
